<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
/*******basic*******/
if($_RQ['op']=='get'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->model('api')->query($postdata['orderid'],$postdata['mailno']);
		exi('','','//list/orderid='.$postdata['orderid'].'&mailno='.$postdata['mailno']);
	}
	$return['item']=array();
	$htmls=array(
		'type'=>'edit',
		'desc'=>'测试查询',
		'edit'=>array(
			array('type'=>'string','title'=>'订单ID','name'=>'orderid'),
			array('type'=>'string','title'=>'运单号','name'=>'mailno'),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='list'){
	$orderid=$_RQ['orderid'];
	$mailno=$_RQ['mailno'];
	$log=pdo_get('jy_yundaapi_log',array('mailno'=>$mailno,'uniacid'=>$_SESSION['uniacid'],"orderid"=>$orderid));
	$log['steps']=json_decode($log['steps'],true);
	$return['log']=$log;
	exi($return);
}
/*******basic*******/
/*******op*******/
